<?php
/**
 * Cube PHP Framework
 * 
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 * 
 * @author Dillen / Steffen
 */

namespace Library\Web;

/**
 * @class Library.Web.Cookies
 * 
 * Cookies class
 */
class Response extends \Library\ArrayObject
{
	public function __construct()
	{
		$this->_storage = array();
	}
    
    public function isPost()
    {
        return strtolower($_SERVER['REQUEST_METHOD']) == 'post';
    }
    
    public function redirect($url, $exit_page = true)
    {
        header('Location: ' . $url);
        if ($exit_page) exit;
    }
	
	public function clear()
	{
		$this->_storage = array();
	}
	
	public function __destruct()
	{
        $this->_storage = null;
	}
}